{include file="common/head"}

<body>
<div class="container-fluid">

  <div class="row">

    <div class="col-md-6 col-xl-3">
      <div class="card bg-primary text-white">
        <div class="card-body">
          <div class="d-flex justify-content-between">
            <span class="avatar-md rounded-circle bg-white bg-opacity-25 avatar-box">
              <i class="mdi mdi-currency-cny fs-4"></i>
            </span>
            <span class="fs-4 scroll-numbers">{$artCount}</span>
          </div>
          <div class="text-end">文章数量</div>
        </div>
      </div>
    </div>

  	<div class="col-md-6 col-xl-3">
  	  <div class="card bg-danger text-white">
  	    <div class="card-body">
  	      <div class="d-flex justify-content-between">
  	        <span class="avatar-md rounded-circle bg-white bg-opacity-25 avatar-box">
              <i class="mdi mdi-account fs-4"></i>
            </span>
  	        <span class="fs-4 scroll-numbers">{$userCount}</span>
  	      </div>
  	      <div class="text-end">用户总数</div>
  	    </div>
  	  </div>
  	</div>

  	<div class="col-md-6 col-xl-3">
  	  <div class="card bg-success text-white">
  	    <div class="card-body">
  	      <div class="d-flex justify-content-between">
  	        <span class="avatar-md rounded-circle bg-white bg-opacity-25 avatar-box">
              <i class="mdi mdi-arrow-down-bold fs-4"></i>
            </span>
  	        <span class="fs-4 scroll-numbers">{$linkCount}</span>
  	      </div>
  	      <div class="text-end">友联数量</div>
  	    </div>
  	  </div>
  	</div>

  	<div class="col-md-6 col-xl-3">
  	  <div class="card bg-purple text-white">
  	    <div class="card-body">
  	      <div class="d-flex justify-content-between">
  	        <span class="avatar-md rounded-circle bg-white bg-opacity-25 avatar-box">
              <i class="mdi mdi-comment-outline fs-4"></i>
            </span>
  	        <span class="fs-4 scroll-numbers">{$cateCount}</span>
  	      </div>
  	      <div class="text-end">（3级）分类数量</div>
  	    </div>
  	  </div>
  	</div>

  </div>
  
  <div class="row">

  	<div class="col-md-6">
  	  <div class="card">
  	    <div class="card-header">
  	      <div class="card-title">每周用户</div>
  	    </div>
  	    <div class="card-body">
  	      <canvas class="js-chartjs-bars"></canvas>
  	    </div>
  	  </div>
  	</div>

  	<div class="col-md-6">
  	  <div class="card">
  	    <div class="card-header">
          <div class="card-title">文章发布</div>
  	    </div>
  	    <div class="card-body">
  	      <canvas class="js-chartjs-lines"></canvas>
  	    </div>
  	  </div>
  	</div>

  </div>
  <div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="card-header">
				<div class="card-title">基本数据</div>
			</div>
			<div class="card-body">
				
				<br><span>当前IP : {$Request.ip}</span>
				<br><span>今日访问量：{$base.heat}</span>
				<br><span>今日IP量：{$base.ip}</span><br>
				<span>操作系统：{$base.os}</span><br>
				<span>PHP版本：{$Think.PHP_VERSION}</span>
			</div>
		</div>
	</div>
</div>

  <div class="row">

  	<div class="col-lg-12">
  	  <div class="card">
  	    <header class="card-header">
  	      <div class="card-title">网页公告</div>
  	    </header>
  		<div class="card-body">
  		  <div class="table-responsive">
  		    <table class="table table-hover">
  		      <thead>
  		        <tr>
  		          <th>#</th>
  		          <th>标题</th>
  		          <th>内容</th>
  		          <th>发布时间</th>
  		          <th>作者</th>
  		        </tr>
  		      </thead>
  			  <tbody>
  			    <tr>
  			      <td>1</td>
  			      <td>设计新主题</td>
  			      <td>
					加快构建后台
  			      </td>
				  <td>2024 10-1</td>
				  <td>怪鸟</td>
  			    </tr>
  			    <tr>
					<td>2</td>
  			      <td>设计新主题</td>
  			      <td>
					加快构建后台
  			      </td>
				  <td>2024 10-1</td>
				  <td>怪鸟</td>
  			    </tr>
  			   
  			  </tbody>
            </table>
  	      </div>
  	    </div>
  	  </div>
    </div>

  </div>

</div>

{include file="common/bottom"}

<script type="text/javascript" src="__lyear__/js/chart.min.js"></script>
<script type="text/javascript" src="__lyear__/js/scroll-numbers.js"></script>
<script type="text/javascript" src="__lyear__/js/main.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
	var $dashChartBarsCnt = jQuery('.js-chartjs-bars')[0].getContext('2d'),
		$dashChartLinesCnt = jQuery('.js-chartjs-lines')[0].getContext('2d');
	var $dashChartBarsData = {
		labels: ['周一', '周二', '周三', '周四', '周五', '周六','周日'],
		datasets: [{
			label: '注册用户',
			borderWidth: 1,
			borderColor: 'rgba(0, 0, 0, 0)',
			backgroundColor: 'rgba(0, 123, 255,0.5)',
			hoverBackgroundColor: "rgba(0, 123, 255, 0.7)",
			hoverBorderColor: "rgba(0, 0, 0, 0)",
			data: {$userTime},
			fill: true,
			lineTension:  0.5
		},
		// datasets: [{
		// 	label: '文章发布',
		// 	data:,
		// 	borderColor: '#007bff',
		// 	backgroundColor: 'rgba(0, 123, 255, 0.175)',
		// 	borderWidth: 1,
		// 	fill: false,
		// 	lineTension:  0.5
		// }]
	]
	};
	var $dashChartLinesData = {
		labels: [ '周一', '周二', '周三', '周四', '周五', '周六','周日'],
		datasets: [{
			label: '文章发布',
			data: {$artTime},
			borderColor: '#007bff',
			backgroundColor: 'rgba(0, 123, 255, 0.175)',
			borderWidth: 1,
			fill: false,
			lineTension:  0.5
		}]
	};

	new Chart($dashChartBarsCnt, {
		type: 'bar',
		data: $dashChartBarsData
	});

	var myLineChart = new Chart($dashChartLinesCnt, {
		type: 'line',
		data: $dashChartLinesData,
	});
});
</script>
</body>
</html>